package org.point.dao.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.point.common.dao.impl.BaseDaoImpl;
import org.point.common.util.DoPage;
import org.point.dao.DeliveryInfoDao;
import org.point.dao.UserLoginDao;
import org.point.domain.ConvertRuleDetail;
import org.point.domain.DeliveryInfo;
import org.point.domain.UserLogin;
import org.point.domain.UserSign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * 
 * @ClassName: ConvertRuleDetailDaoImpl  
 * @Description: TODO(兑换规则明细数据实现类)  
 * @author Kenny_Z' szqiuk@gmail.com
 * @date 2016年10月23日 下午3:28:17  
 *
 */
@Repository("UserLoginDao")
public class UserLoginDaoImpl extends BaseDaoImpl<UserLogin, Serializable> implements UserLoginDao {

	private static final String SQLID_SEARCHFORUSERLOGINPAGE = "search_For_UserLogin_page";
	private static final String SQLID_SEARCHFORUSERLOGINCOUNT = "search_For_UserLogin_count";
	private static final String SQLID_SEARCHUSERLOGIN = "search_userLogin";

	/**
	 * 利用反射，获取mapper.xml的namespace
	 * <p>Title: </p>  
	 * <p>Description: </p>
	 */

	
	public UserLoginDaoImpl() {
		namespace = super.getNamespace();
	}

	public List<UserLogin> searchForUserLogin(DoPage<UserLogin> page) {
		List<UserLogin> records = null;
		try {
			records = getSqlSession().selectList(namespace + SQLID_SEARCHFORUSERLOGINPAGE, page);
		} catch (Exception e) {
			throw new RuntimeException("查询数据总记录数错误！", e);
		}
		return records;
	}

	public Integer searchForUserLoginCount(DoPage<UserLogin> page) {
		Integer result = 0;
		try {
			result = getSqlSession().selectOne(namespace + SQLID_SEARCHFORUSERLOGINCOUNT, page);
		} catch (Exception e) {
			throw new RuntimeException("查询数据总记录数错误！", e);
		}
		return result;
	}

	public List<UserLogin> searchUserLoginMap(Map<String, Object> map) {
		List<UserLogin> userLogins = getSqlSession().selectList(SQLID_SEARCHUSERLOGIN);
		return userLogins;
	}


}
